package com.jsp.service;

import java.sql.SQLException;

import com.jsp.bean.VehicleBean;
import com.jsp.dao.VehicleDao;

public class VehicleService {

	private VehicleBean vehiclebean;
	private VehicleDao vehicleDao;
	
	public VehicleBean insert(String plateNumber, String models, String productDate,
			String driverInformation, String state) throws SQLException{
		vehiclebean=new VehicleBean(plateNumber, models, productDate, driverInformation, state);
		vehicleDao=new VehicleDao();
		return vehicleDao.insert(vehiclebean);
		
	}
	public VehicleBean detele(String id,String plateNumber, String models, String productDate,
			String driverInformation, String state) throws SQLException{
		vehiclebean=new VehicleBean(id,plateNumber, models, productDate, driverInformation, state);
		vehicleDao=new VehicleDao();
		return vehicleDao.detele(vehiclebean);
		
	}
	public VehicleBean update(String id, String plateNumber, String models,
			String productDate, String driverInformation, String state) throws SQLException {
		vehiclebean=new VehicleBean(id,plateNumber, models, productDate, driverInformation, state);
		vehicleDao =new VehicleDao();
		// TODO Auto-generated method stub
		return vehicleDao.update(vehiclebean);
	}

}
